#include "process.h"

char style[S_NUM]={'#','=','*','>','-'};

void ProcessOn()//函数的定义
{
	int cnt =0;
	char bar[NUM];
	memset(bar,'\0',sizeof(bar));

	//reverse
	const char* lable ="|\\-/";
	//101 times
	while(cnt <= 100)
	{
		//printf("[%-100s][%-3d%%][%c]\r",bar,cnt,lable[cnt%4]);
		printf("\033[0m\033[1;32m[%-100s][%-3d%%][%c]\033[0m\r",bar,cnt,lable[cnt%4]);
		fflush(stdout);
		bar[cnt++] = style[N];
		//sleep(1);
		usleep(50000);//5/100 == 0.05 ==0.05 * 1000000
	}
	printf("\n");
}
